package sesi.ejava.bcam;

import sesi.ejava.control.ControlActivity;
import sesi.ejava.monitoring.MonitoringActivity;
import sesi.ejava.settings.SettingsActivity;
import sesi.ejava.stream.BluetoothManager;
import sesi.ejava.stream.ServerActivity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;

/**
 * This class provides the main activity of the becam application. This activity
 * is composed by severals buttons that take the user to the different functions
 * of the application.
 * 
 * @see MonitoringActivity
 * @see BluetoothManager
 * @see SettingsActivity
 * @see ControlActivity
 * 
 */
public class BcamActivity extends Activity {

	private ImageView imgMonitoring;
	private ImageView imgSettings;
	private ImageView imgControl;
	private ImageView imgServer;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		/*imgBluetooth = (ImageView) findViewById(R.id.imgBluetooth);
		imgBluetooth.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {
				Intent bluetoothManagerIntent = new Intent(v.getContext(),
						BluetoothManager.class);

				startActivity(bluetoothManagerIntent);
			}
		});*/

		imgMonitoring = (ImageView) findViewById(R.id.imgMonitoring);
		imgMonitoring.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {
				Intent monitoringActivityIntent = new Intent(v.getContext(),
						MonitoringActivity.class);

				startActivity(monitoringActivityIntent);
			}
		});

		imgSettings = (ImageView) findViewById(R.id.imgSettings);
		imgSettings.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {
				Intent settingsActivityIntent = new Intent(v.getContext(),
						SettingsActivity.class);
				startActivity(settingsActivityIntent);
			}
		});
		
		
		imgControl = (ImageView) findViewById(R.id.imgControl);
		imgControl.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {
				Intent controlActivityIntent = new Intent(v.getContext(),
						ControlActivity.class);
				startActivity(controlActivityIntent);
			}
		});

		imgServer = (ImageView) findViewById(R.id.imgServer);
		imgServer.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {
				Intent serverActivityIntent = new Intent(v.getContext(),
						ServerActivity.class);
				startActivity(serverActivityIntent);
			}
		});

	}
}